-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for pyproject.toml
configuration.
#301
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I like the idea! I think we should make a couple small changes, and then I would love to accept this.
- Let's switch back to
tomllib
, and just skip handling pyproject.toml iftomllib
is not present. I don't feel like it's worth adding a dependency for one of the oldest versions of python we support (and will eventually drop support for). - Please add test(s) in
green/test/test_config.py
!
😄
I have seen other projects make tomllib an optional dependency only for older versions of python: prior to 3.11. We could have similar logic here. |
I've added support using the specifier found at https://github.com/hukkin/tomli to allow toml support on versions below 3.11. |
I'm not sure why the CI isn't running automatically. I enabled it...again. Let's get this problem fixed:
|
Co-authored-by: Stephane Odul <1504511+sodul@users.noreply.github.com>
Sorry for the delay, but here are the changes. They should work for setting the version identifier. Let me know if there's anything else! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Will you please merge |
In relation to #300, this pulls request adds the feature. The current implementation makes use of tomlkit to support 3.8 compatibility. If the project moves to only support 3.11 and up, then tomlkit can be replaced with tomllib (built-in to Python stdlib).
The current ordering places the
pyproject.toml
configuration directly before cli commands, making it the last configuration file to be parsed. This pushes new users to use thepyproject.toml
configuration.Usage
To use the new configuration, add a section named
[tool.green]
into yourpyproject.toml
:And green will take it from there.